//
//  SYRequestAPI+Wode.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/5/25.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "SYRequestAPI+Wode.h"
//#define WoDeMainUrl @"mine/AccountService.svc/AccountInfo"
NSString *const BASE_MYCENTER_URL = @"mine/MineService.svc/";
NSString *const MYCENTER_AccountInfo_URL = @"AccountInfo";//账户信息
NSString *const MYCENTER_ModifyAccountInfo_URL = @"ModifyAccountInfo";//修改账号密码
//财富
//NSString *const BASE_Treasure_URL = @"mine/MineService.svc/";
NSString *const MYCENTER_FundService_URL = @"FundInfo";//我的财富
NSString *const MYCENTER_SafeService_URL = @"ChangePassword";//修改密码
NSString *const MYCENTER_ChangeMobile_URL = @"ChangeMobile";//更新手机号
NSString *const MYCENTER_FeeLog_URL = @"FeeLog";//资金明细
NSString *const MYCENTER_IntegralLog_URL = @"IntegralLog";//积分明细
NSString *const MYCENTER_Agreement_URL = @"Agreement";//隐私条款
NSString *const MYCENTER_GetVerifyCode_URL = @"common/VerifyService.svc/GetVerifyCode";//发送验证码

@implementation SYRequestAPI (Wode)
//账户详情
+ (void)sy_getAccountServiceAccountInfo:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_AccountInfo_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
//        NSLog(@"账户详情-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getAccountServiceModifyAccountInfo:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
     NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_ModifyAccountInfo_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"修改账户详情-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getFundServiceFundInfo:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_FundService_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"我的财富-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceChangePassword:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_SafeService_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"修改密码-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceChangeMobile:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_ChangeMobile_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"更新手机号码-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceGetVerifyCode:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@",MYCENTER_GetVerifyCode_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"j获得验证码-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceFeeLog:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_FeeLog_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"资金明细（可根据日期、分类查询-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceIntegralLog:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_IntegralLog_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"积分明细（可根据日期、分类查询-失败 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceAgreement:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,MYCENTER_Agreement_URL];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"隐私条款 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceCheckUpdate:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,@"CheckUpdate"];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"检查更新 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
+ (void)sy_getSafeServiceLogout:(NSDictionary *)parama success:(void(^)(id responseObject))success fail:(FailBlock)fail{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_MYCENTER_URL,@"Logout"];
    [SYRequestAPI postDataFromURLScheme:url parameterDictionary:parama success:^(id responseObject) {
        success(responseObject);
    } fail:^(NSError *error) {
        NSLog(@"安全退出 %@",error);
        if (fail) {
            fail(error);
        }
    }];
}
@end
